import axios from '../plugins/axios'

// 添加位置
export const addPositons = (data: ModelType) => {
   return axios.request<{ message: string; statusCode: number }>({
      url: `addPositions?latitude=${data.latitude}&longitude=${data.longitude}&positionName=${data.userId}`,
      method: 'get'
   })
}

// 根据当前经纬度获取周围指定范围的人
interface Params {
   latitude: number
   longitude: number
   radius: number
}
export const getNearbyPositions = (data: Params) => {
   return axios.request<ResponseTypes<ModelType[]>>({
      url: `getNearbyPositions?latitude=${data.latitude}&longitude=${data.longitude}&radius=${data.radius}`,
      method: 'get'
   })
}
